#include <sys/types.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/syscall.h>

int main()
{
  pthread_t ptid = pthread_self();
  //  pid_t ktid = gettid();  

  pid_t ktid = (pid_t) syscall (SYS_gettid);
  pid_t pid = getpid();
  printf("pthread id = %ld\n",(long)ptid);
  printf("gettid = %ld\n",(long)ktid);
  printf("getpid = %ld\n",(long)pid);
  return 0;
}
